package portal.mybatis.dao.service;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import portal.mybatis.dao.HistoryAlgorithm;
import portal.mybatis.dao.mapper.HistoryAlgorithmMapper;
@Service
public class HistoryAlgorithmService {
	@Autowired
	private HistoryAlgorithmMapper haMapper;
	public boolean updateEndTimeByKey(String taskHash,String algorithmHash){
		return haMapper.updateEndTimeByKey(new HistoryAlgorithm(taskHash,algorithmHash,new Date()))>0;
	}
	public boolean insertHistoryAlgorithm(String taskHash, String blockId, String state, String algorithmId, int size){
		return haMapper.insertHistoryAlgorithm(new HistoryAlgorithm(taskHash,blockId,null,state,algorithmId,size))>0;
	}
//	public boolean updateEndTime(String taskHash,String algorithmHash){
//		return haMapper.
//	}
}
